package com.routz.wxarticlelist.demo.base_util;

import java.util.Optional;

public class Validator {
    public static boolean hasText(String str) {
        return str != null && !"".equals(str);
    }

    public static String verifyText(String str) {
        return Optional.ofNullable(str).filter(Validator::hasText)
                .orElseThrow(()->new IllegalArgumentException("Invalid String."));
    }
}
